home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr28 / dats520.zip / DATECHK.DOC < prev    next >
Text File  |  1995-02-13  |  11KB  |  253 lines

  1.  
  2.                             Date Check ver 5.20
  3. _______________________________________________________________________________
  4.  
  5.  
  6.                             What is Date Check?
  7.  
  8.         Date Check was created out of necessity to automatically perform
  9. daily, weekly and monthly maintenance that needs to be done (and if you are like
  10. me, forget without fail!)
  11.  
  12.                           How do I use Date Check?
  13.         Date Check is very simple to use.  Just copy it to your main directory,
  14. and make it the last line in your AUTOEXEC.BAT.  Also make sure the
  15. COMSPEC environment variable is set to identify the command interpreter
  16. you are using.  (If you are using NDOS, Date Check automatically takes
  17. care of the descriptions of it's work files.)  Create a batch file
  18. called "DAILY.BAT" for daily maintenance, and a batch file called
  19. "MONTHLY.BAT" for monthly maintenance, and a batch file called "WEEKLY.BAT"
  20. for weekly maintenance.  You may omit any combination of the batch files if
  21. you please.  If you wish, run DATECHK /CHECK to verify that your batch
  22. files are running properly. Use the /AUTO switch on the command line, to do
  23. maintenance unprompted.  Do not mix the /AUTO and the /CHECK switches!  If
  24. you do, Date Check will use neither switch!
  25.         User time intervals now implemented.  Also added the option for
  26. Yearly checks.  Use "USER.BAT" and "YEARLY.BAT", respectively.  Date Check
  27. will automatically recognize an older Date Check record file, or none at
  28. all, and prompt for a User interval.  Enter "0" to not use this option.  As
  29. a consequence, DATECHK.REC should, after the upgrade, be 5 bytes.  You may
  30. use any user interval, in days, 1-511, theoretically.  I recommend sticking
  31. within the range 2-365, as these are the logical values anyone would want
  32. to use, in my opinion.   Any other value above 511, and the program will
  33. strip off the lowest-order bits, and shift the highest-order 9 bits to the
  34. right.  (If you are not a programmer, don't worry about it, just DON'T do it.)
  35. DATECHK.REC should no longer exist.  (Let the upgrade take care it!).
  36.  
  37.                         Date Check Zips
  38.         Like a lot of programmers have been doing lately, I have
  39.         taken to giving naming rules to my ZIP files.
  40.  
  41.         DAT [NS|S] VER
  42.  
  43.         In other words, version 99 with source would be named DATS99.ZIP
  44.                                    ...and without source      DATNS99.zip
  45.         Not too difficult, I hope...
  46.  
  47.  
  48.                         Revision History
  49.  
  50.         ver .5 ßeta
  51.         Original version of program... One word... SUCKED!!!  Only could
  52.         handle monthly and daily maintenance, and had a few glitches in the
  53.         algorithm.
  54.  
  55.         ver .99 ßeta
  56.         Added Weekly Maintenance.  Also added a few diagnostic options, to
  57.         check for bugs more efficiently.  Problem with weekly maintenance,
  58.         I had to use someone else's code until I could correct it.  Didn't
  59.         want do, because of possible copyright infringements.
  60.  
  61.         ver 1.00
  62.         Finally perfected weekly code.  Was informed by someone that the year
  63.         2000 was NOT a leap year, although it is divisible by 4.  Created code
  64.         to count up days, and then get the modulus for the weekday.  Optimized
  65.         the code so some delays were taken care of.  This is about as best as
  66.         the program can get. Decided to release it to public.
  67.  
  68.         ver 1.01
  69.         Ok, so it wasn't the best... I fixed a bug for when Datechk would
  70.         be first run, it would give me an overflow error.  I also
  71.         compressed the date storage. (Ok, so it was small to begin with...
  72.         I did it just to see if I could do it...) I reduced the file from 12
  73.         bytes to 3 bytes.  No big deal, but I intend to use the technology
  74.         in other programs I have.  The program will automatically erase and
  75.         update the old DATE.REC.
  76.  
  77.         ver 1.02        
  78.         I optimized the routines, reduced code from constants to loops, and
  79.         reduced the DATE.REC to 2 bytes... (Yes I'm obsessed with trying to 
  80.         see what I can do.)
  81.  
  82.         ver 1.03
  83.         Further optimization, and Found out that the year 2000 is, in fact,
  84.         a leap year.  Would not have run into problems till year 2000, but
  85.         I hate a messy program.
  86.  
  87.         ver 1.04
  88.         Added capability to choose whether or not to execute the batch
  89.         files
  90.  
  91.         ver 2.00
  92.         I've optimized ALL of the routines to the best of my ability for
  93.         speed  I also put most of the key options in CONST statements, for
  94.         ease in customizing.  I've decided that I would finally just release
  95.         this program into the public domain, considering that
  96.  
  97.         1. No one sent me money (Damn!!!)
  98.         2. I have been mainly programming this for myself
  99.  
  100.         Because of this, I've also decided that I'd also release the
  101.         QuickBasic source code, and you can customize the program for you
  102.         own needs.  I will release a version in C a few months down the
  103.         road, and to make it easier on myself, I've been practicing
  104.         programming in structured code, since C has no "GOTO" statement.
  105.         Other minor changes:
  106.  
  107.         1. DATE.REC is now DATECHK.REC
  108.         2. Optimized "Days" function... MUCH faster than the original
  109.         3. Moved most Module-level code into Subs and Functions, to reduce
  110.         data storage needs
  111.  
  112.         ver 2.10
  113.         I've cut out the diagnostic code, because of it taking up to much
  114.         programming time.  (Normally not noticeable to the public, but use
  115.         the /manip switch on the dos command line in versions 2.0 and
  116.         earlier.)  Added the /AUTO switch, which allows you to do
  117.         maintenance unprompted.
  118.  
  119.         ver 2.20
  120.         Further code optimization.  Cut out some more code, for which the only
  121.         reason it was there was to support the "/MANIP" function cut out of
  122.         the last version.
  123.  
  124.         ver 3.00
  125.         USER.BAT and YEARLY.BAT now implemented.  Removed more unnecessary
  126.         code.  Debugged USER and YEARLY routines.
  127.  
  128.         ver 3.50
  129.         Maintenance release.  Added funny looking files.  Current files
  130.         included are:
  131.         DATECHK.EXE     Main Executable
  132.         DATECHK.DAT     Data File
  133.         DATECHK.REC     Date Check Record File (Should not exist initially!)
  134.         README.COM      You are reading this!
  135.         DATECHK.BAS     Date Check Source Code
  136.         FILE_ID.DIZ
  137.  
  138.         ver 3.51
  139.         Maintenance release.
  140.  
  141.         ver 3.60
  142.         Deleted DATECHK.REC.  Current Files Are (AFTER FIRST RUN!!!):
  143.         DATECHK.EXE\
  144.         DATECHK.DAT/ Only files NEEDED to run!!!  MUST be in same
  145.                      directory.
  146.         README.COM
  147.         DATECHK.BAS
  148.         LISTDATA.BAS\
  149.         MAKEDATA.BAS/ Example programs.  Explained in Tech. Section.
  150.         FILE_ID.DIZ
  151.  
  152.         ver 3.61
  153.         MAJOR maintenance release.  It is recommended that you either run
  154. this version, or ver 3.51.  Last version had bugs in the ReadDate$
  155. function.
  156.  
  157.         ver 4.00
  158.         Redesigned DATECHK.DAT.  Make sure you copy new file over the old
  159. one.  Major code rewrite.
  160.  
  161.         ver 5.00
  162.         Major code re-write.  DATECHK.BAS has now been re-written for
  163. Visual Basic for DOS ver 1.00.  I did this to take advantage of VB's
  164. advanced functions.  DATECHK.BAS can no longer be run in QB.  LISTDATA and
  165. MAKEDATA can be run in either Visual Basic for DOS or QB 4.5.
  166.  
  167.         ver 5.20
  168.         Bug fixes, Cosmetic improvements.  Further optimizations for use
  169. under VB for DOS.  More code reductions.
  170.  
  171. Technical Section:
  172.         I though I would add this section so that beginning programmers do
  173. not screw up the program Data Files.  The DATECHK.DAT is not meant to
  174. Hex-Edit, but since there are people who would try it anyway...
  175. The DAT file is divided as such:The first record is 5 bytes, and should NOT
  176. be altered. The first 5 bytes are actually bit fields.  This is how it works...
  177.  
  178. |  ||    ||     | |        ||        |
  179. 43215432 17654321 98765432 19876543 21UNUSED
  180. 00000000 00000000 00000000 00000000 00000000
  181.  
  182. Field   Meaning
  183. 1       Current Recorded Month
  184. 2       Current Recorded Day
  185. 3       Current Recorded (Year - 1980)
  186. 4       Recorded User Interval
  187. 5       Recorded Accumulation till next User event
  188.  
  189. To decide whether or not to execute "USER.BAT", the program checks Field 4
  190. against Field 5.  If they are equal, Field 5 is set to "000000000" and the
  191. count begins again.  For all others, Fields 1,2,3 are checked against the
  192. current date.
  193.  
  194. The rest of the file is in 62-byte records, as follows:
  195.  
  196. First two bytes are as previous date record, with the "Year" field being
  197. ignored The next 60 are a message to pop up on the previous record's date.
  198.  
  199. Being the Holidays, I came up with the Idea that the program could also
  200. wish the user a happy "whatever".  I like the idea... :)  I've included in
  201. this version 2 example programs for working with Datechk.DAT.  ListData
  202. outputs a file, called "OUTPUT.LST" that lists the current holidays stored
  203. in the DATECHK.DAT.  Programmers note: ReadDate$ function is slightly
  204. different than the one in DATECHK.BAS.  Do not interchange!  MakeData will
  205. either add on to a current DATECHK.DAT, or make a new one.
  206.  
  207. Programmers Notes:
  208.         Complete rewrite of the following functions:
  209.         ReadDate$ function - Now TranslateDate$.  Interperates any 2-byte
  210. string into the MM-DD-YYYY format.
  211.         InitDateCheck sub - Added support for the new TranslateDate$
  212. function.
  213.         HolidayCheck sub - Files are no longer opened as RANDOM files.  All
  214. files are opened as BINARY.  Eliminated the need to open the same file two
  215. different ways.  IMPORTANT!  Now Record.Date is DIRECTLY passed to the new
  216. Translate function.
  217.         Main Module - Support for TranslateDate$ added.
  218.  
  219. ver 5.00 Programmers update.
  220.         FixBin$, Num2Bin$, Bin2Num, Logx no longer necessary!  I figured
  221. out how to use the "AND" operator for Binary operations.  I also kicked
  222. myself in the head for not thinking of it earlier! :).  Removed about 5k
  223. worth of code that was unnecessary with VB for DOS.  All interfaces and
  224. functions do the same thing, although some functions have been re-written
  225. for optimization.
  226.  
  227. _______________________________________________________________________________
  228.  
  229.  
  230.  
  231.         One last word... Good Luck to all you programmers and
  232.                 hackers out there, wherever you are!!!! :)
  233.  
  234.                                                 -Brian Fields
  235.  
  236.                        Who do I contact in case of problems?
  237.         Contact:
  238.                         Brian Fields
  239.                         22 Bellview Rd.
  240.                         Marysville, PA 17053
  241.                         (717) 957-4921
  242.  
  243. I would like to express my thanks to the following people:
  244.  
  245.         R. Bradford (Fubar) Peters - for help with the code, and
  246.         distribution.
  247.  
  248.         Jonathan Stevens - for teaching me some of the code used herein.
  249.  
  250.         Gerald Eltringham - for putting up with me for the last THREE
  251.         years, and for continuing to do so :).
  252.  
  253.